package com.chenfan.mcn.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chenfan.mcn.enums.ExcutionOrderTypeEnum;
import com.chenfan.mcn.model.McnPage;
import com.chenfan.mcn.model.dto.UnPayBackContractDTO;
import com.chenfan.mcn.model.dto.UnPayBackRankDTO;
import com.chenfan.mcn.model.vo.*;
import com.chenfan.mcn.model.common.PageInfo;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author: tangwei
 * Date:     2021/3/9 13:54
 * Description: 首页数据统计
 */
public interface DataStatisticsService {

    /**
     * 客户投放金额（本月）
     *
     * @param page {@link McnPage}
     * @return
     */
    Page<CustomerInvestmentAmount> customerInvestmentAmount(McnPage<CustomerInvestmentAmount> page);

    /**
     * 红人月度执行单数量&金额（本月）
     *
     * @param type {@link Integer}
     * @param page {@link McnPage}
     * @return
     */
    Page<RedManMonthlyExecution> redManMonthlyExecution(Integer type, McnPage<RedManMonthlyExecution> page);

    /**
     * 签订收入合同总金额
     *
     * @return BigDecimal
     */
    BigDecimal incomeContractTotalAmount();

    /**
     * 执行单已执行金额
     *
     * @return BigDecimal
     */
    BigDecimal excutedAmount();

    /**
     * 执行单执行数量
     *
     * @param type {@link ExcutionOrderTypeEnum}
     * @return List<ExcutionOrderCountVO>
     */
    List<ExcutionOrderCountVO> totalCount(Integer type);

    /**
     * 合同签订情况（本月）
     *
     * @return {@link List<ContractSigning>}
     */
    List<ContractSigning> contractSigning();

    /**
     * 部门业绩情况(本月)
     *
     * @return {@link List<DepartmentPerformance>}
     */
    List<DepartmentPerformance> departmentPerformance();

    /**
     * 未回款合同
     *
     * @param unPayBackContractDTO {@link UnPayBackContractDTO}
     * @return UnPayBackContractVO {@link UnPayBackContractVO}
     */
    PageInfo<UnPayBackContractVO> unPayBackContract(UnPayBackContractDTO unPayBackContractDTO);

    /**
     * 首页-累计回款金额、累计未回款金额、累计签单金额
     *
     * @param unPayBackContractDTO {@link UnPayBackContractDTO}
     * @return GrandAmountVO
     */
    GrandAmountVO grandAmount(UnPayBackContractDTO unPayBackContractDTO);

    /**
     * 首页-未回款排行
     *
     * @param unPayBackRankDTO {@link UnPayBackRankDTO}
     * @return PageInfo<UnPayBackRankVO> {@link UnPayBackRankVO}
     */
    PageInfo<UnPayBackRankVO> unPayBackRank(UnPayBackContractDTO unPayBackRankDTO);

    /**
     * 首页-合品牌作排名
     *
     * @param page 分页
     * @return Page<RankingOfCooperativeBrands>
     */
    Page<RankingOfCooperativeBrands> rankingOfCooperativeBrands(McnPage<RankingOfCooperativeBrands> page);

    /**
     * 首页-当前季度部门回款率
     *
     * @param page 分页
     * @return Page<DepartmentCollectionRate>
     */
    Page<DepartmentCollectionRate> departmentCollectionRate(McnPage<DepartmentCollectionRate> page);
}